<html>
  <head>
    <title>jQuery Tutorial 1</title>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
function showMsg() {
    $('#btn').attr('disabled', true);
    if ($('#msg').html().length == 0) {
        $('#msg').html('<h1>Hello</h1>');
    }
    $('#msg').fadeIn();
    setTimeout(function(){
        $('#msg').fadeOut();
        $('#btn').attr('disabled', false);
    }, 3000);
}
    </script>
  </head>
  <body>
    <div id="msg"></div>
    <input type="button" value="Click Me" onclick="showMsg()"/>
    <div id="msg"></div>
    <input type="button" value="Click Me" onclick="showMsg()"/>
  </body>
</html>
